<!DOCTYPE html>
<HTML>
<HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<LINK href="img_files/pop.css" type=text/css rel=stylesheet>
<STYLE type=text/css>BODY {
	FONT: 9pt "宋体", Verdana, Arial, Helvetica, sans-serif
}
A {
	FONT: 9pt "宋体", Verdana, Arial, Helvetica, sans-serif
}
TABLE {
	FONT: 9pt "宋体", Verdana, Arial, Helvetica, sans-serif
}
DIV {
	FONT: 9pt "宋体", Verdana, Arial, Helvetica, sans-serif
}
SPAN {
	FONT: 9pt "宋体", Verdana, Arial, Helvetica, sans-serif
}
TD {
	FONT: 9pt "宋体", Verdana, Arial, Helvetica, sans-serif
}
TH {
	FONT: 9pt "宋体", Verdana, Arial, Helvetica, sans-serif
}
INPUT {
	FONT: 9pt "宋体", Verdana, Arial, Helvetica, sans-serif
}
SELECT {
	FONT: 9pt "宋体", Verdana, Arial, Helvetica, sans-serif
}
BODY {
	PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px
}
</STYLE>
<script src="../../inc/common.js"></script>
<SCRIPT language=JavaScript>
var parentWin;
var ctlType;
var editObj;
var mode;

function ok() {
	if (ctlName.value=="") {
		alert("请填写标识！");
		return;
	}
	if (ctlTitle.value=="") {
		alert("请填写名称！");
		return;
	}
	if (mode=="create")
		parentWin.CreateCalendarCtl(ctlType, ctlName.value, ctlTitle.value, defaultValue.value, format.value, canNull.value, minT.value,minV.value,maxT.value,maxV.value);
	else {
		// name值是变不了的
		editObj.name = ctlName.value;
		editObj.title = ctlTitle.value;
		
		editObj.setAttribute("canNull", canNull.value);
		editObj.setAttribute("minT", minT.value);
		editObj.setAttribute("minV", minV.value);
		editObj.setAttribute("maxT", maxT.value);
		editObj.setAttribute("maxV", maxV.value);
		
		editObj.value = defaultValue.value;
	}
	window.close();
}

function window_onload() {
	parentWin =	dialogArguments[0];
	mode = dialogArguments[1];
	if (mode=="create")
		ctlType = dialogArguments[2];
	else {
		editObj = dialogArguments[2];
		ctlName.disabled = true;
		ctlName.value = editObj.name;
		ctlTitle.value = editObj.title;
		defaultValue.value = editObj.value.trim();
				
		if (editObj.getAttribute("kind")=="DATE_TIME")
			format.value = "yyyy-MM-dd HH:mm:ss";
		format.disabled = true;
		
		canNull.value = editObj.getAttribute("canNull");
		if (canNull.value=="")
			canNull.value = "1";
		
		minT.value = editObj.getAttribute("minT");
		if (minT.value=="")
			minT.value = "d=";
		
		minV.value = editObj.getAttribute("minV");
		if (minV.value=="undefined")
			minV.value = "";
			
		maxT.value = editObj.getAttribute("maxT");
		if (maxT.value=="")
			maxT.value = "x="
		
		maxV.value = editObj.getAttribute("maxV");
		if (maxV.value=="undefined")
			maxV.value = "";
	}
}
</SCRIPT>
</HEAD>
<BODY bgColor=menu onLoad="window_onload()">
<TABLE width="293" border=0 align=center cellPadding=0 cellSpacing=0>
  <TBODY>
  <TR>
    <TD height="28" align=center>控件字段：</TD>
    <TD height="28" align=left><input id="ctlName" name="ctlName" type="text" style="width: 200px; height:22px" maxlength="30"></TD>
  </TR>
  <TR>
<TD width="86" height="28" align=center>控件名称：</TD>
<TD width="207" height="28" align=left><input type="text" name="ctlTitle" style="width: 200px; height:22px"></TD>
  </TR>
  <TR>
    <TD width="86" height="28" align=center>默&nbsp;认&nbsp;值：</TD>
    <TD width="207" height="28" align=left>
	<select name="defaultValue" id="defaultValue">
      <option value="CURRENT">当前时间</option>
      <option value="" selected>无</option>
    </select></TD>
  </TR>
  <TR>
    <TD height="28" align=center>格&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;式：</TD>
    <TD height="28" align=left>
	<select name="format">
      <option value="yyyy-MM-dd" selected>年-月-日</option>
      <option value="yyyy-MM-dd HH:mm:ss">年-月-日 时：分：秒</option>
    </select></TD>
  </TR>
  <TR>
    <TD height="28" align=center>必&nbsp;填&nbsp;项：</TD>
    <TD height="28" align=left><select name="canNull">
        <option value="1">否</option>
        <option value="0">是</option>
      </select>
      
       </TD>
  </TR>
  <TR>
    <TD height="28" align=center> 长度/大小：</TD>
    <TD height="28" align=left><select name="minT">
        <option value="d=">&gt;=</option>
        <option value="d">&gt;</option>
        <option value="=">=</option>
      </select>
        <input name="minV" style="width:40px">
        <select name="maxT">
          <option value="x=">&lt;=</option>
          <option value="x">&lt;</option>
        </select>
        <input name="maxV" style="width:40px"></TD>
  </TR>
  <TR>
    <TD colspan="2" align=center><input name="submit" type=submit id=Ok onClick=ok() value=确定>
&nbsp;&nbsp;
<input name="button" type=button onClick=window.close(); value=取消></TD>
  </TR>
</TBODY></TABLE>
</BODY></HTML>
